package network;

/**
 * Created by xuhengyu on 15/3/28.
 * 数据错误接口实现
 */
public class DataSourceError implements IDataSourceError {

    DataSourceErrorType type;
    String text;
    String json;

    public DataSourceError(DataSourceErrorType type, String text, String json) {
        this.type = type;
        this.text = text;
        this.json = json;
    }

    public DataSourceError(DataSourceErrorType type, String text) {
        this.type = type;
        this.text = text;
    }

    @Override
    public DataSourceErrorType errorType() {
        return type;
    }

    @Override
    public String errorText() {
        return text;
    }

    @Override
    public String getJson() {
        return json;
    }

    @Override
    public String toString() {
        if(text!=null){
            return text;
        }
        return "";
    }
}
